home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: watserv3.uwaterloo.ca!news
- From: ggdan@konec.uwaterloo.ca (T. Daniel Liebster)
- Subject: Re: malloc() function and new operator
- Message-ID: <DpKDyG.Gnn@watserv3.uwaterloo.ca>
- Sender: news@watserv3.uwaterloo.ca
- Nntp-Posting-Host: cnts2p24.uwaterloo.ca
- Organization: University of Waterloo
- X-Newsreader: Forte Free Agent 1.0.82
- References: <4kbo18$t1s@news.NetVision.net.il>
- Date: Mon, 8 Apr 1996 22:16:45 GMT
-
- nir@netvision.net.il (Nir Sofer) wrote:
-
- >I use in my C/C++ programs both malloc() function and new operator.
- >i use new and delete operators for objects and malloc() and free()
- >functions for allocating strings and other variables.
- >
- >i compile my programs with Borland C++ 4.0
- >it works fine, but i want to be sure that i'm not doing something
- >wrong that will cause troubles in the future.
-
- >Is it o.k to use both of them in the same program ?
-
- There is nothing wrong with using them both as long as you only use
- 'delete' on pointers that were returned by 'new' and only free()
- memory that was allocated using malloc().
-
-
- >Nir Sofer
- >nir@netvision.net.il
-
-
-
-
-
-
-
-
-